package com.vcms.controller.customer.states;

import com.vcms.controller.system.MainController;
import com.vcms.controller.customer.TransactionController;
import com.vcms.view.simulation.system.SimulatorControlPanel;

public class MaintenanceState extends TransactionState {

	public MaintenanceState(TransactionController transactionController){
		setTransactionController(transactionController);
	}
	
	@Override
	public boolean handleDisplayCustomerPanel() {
		System.out.println("[MaintenanceState] - Incorrect state to handle display customer panel!");
		
		return false;
	}
	
	@Override
	public boolean handleStartTransaction() {
		System.out.println("[MaintenanceState] - Incorrect state to handle start transaction!");
		
		return false;
	}
	
	@Override
	public boolean handleProcessMoneyReceived() {
		System.out.println("[MaintenanceState] - Incorrect state to handle process money received!");
		
		return false;
	}
	
	@Override
	public boolean handleCompleteTransaction() {
		System.out.println("[MaintenanceState] - Incorrect state to complete transaction!");
		
		return false;
	}
	
	@Override
	public boolean handleTerminateTransaction() {
		System.out.println("[MaintenanceState] - Incorrect state to terminate transaction!");
		
		return false;
	}
	
	@Override
	public boolean handleTerminateFault() {
		System.out.println("[MaintenanceState] - Incorrect state to handle terminate fault!");
		
		return false;
	}
	
	@Override
	public boolean handleRefreshCustomerPanel() {
		System.out.println("Inside Maintenance State Handle - Maintainer Log in");
		TransactionController transactionController = getTransactionController();
		MainController mainController = transactionController.getMainControler();
		
		SimulatorControlPanel scp = mainController.getSimulatorControlPanel();
		scp.setActive(SimulatorControlPanel.ACT_CUSTOMER, true);
		scp.setActive(SimulatorControlPanel.ACT_CUSTOMER_ALPHANUMERIC, true);
		scp.setActive(SimulatorControlPanel.ACT_CUSTOMER_NUMERIC, true);
		
		// Transit to INITIAL state
		transactionController.transitState(StateFactory.getInstance().create(TransactionState.INITIAL, transactionController));
		
		return false;
	}

	public void printState(){
		System.out.println("- Maintenance State -");
	}
}
